﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Masterduner.SourceStudio.Practices.DevelopmentLibrary.Utilities.DataConfiguration.Controls
{
    public partial class ConnectionDescription : UserControl
    {
        private string _connectionName;
        private string _connectionString;
        private string _errorHandleMode;
        private int _commandTimeout;
        private string _providerName;

        #region ConnectionName
        public string ConnectionName
        {
            get { return _connectionName; }
            set
            {
                _connectionName = value;
                this.label1.Text = string.Format("连接名称：{0}", value);
            }
        }
        #endregion

        #region ConnectionString
        public string ConnectionString
        {
            get { return _connectionString; }
            set
            {
                _connectionString = value;
                this.label2.Text = string.Format("连接串：{0}", value);
            }
        }
        #endregion

        #region ErrorHandleMode
        public string ErrorHandleMode
        {
            get { return _errorHandleMode; }
            set
            {
                _errorHandleMode = value;
                this.label3.Text = string.Format("异常处理方式：{0}", value);
            }
        }
        #endregion

        #region CommandTimeout
        public int CommandTimeout
        {
            get { return _commandTimeout; }
            set
            {
                _commandTimeout = value;
                this.label4.Text = string.Format("数据库命令超时：{0}秒", value);
            }
        }
        #endregion

        #region ProviderName
        public string ProviderName
        {
            get { return _providerName; }
            set
            {
                _providerName = value;
                this.label5.Text = string.Format("数据库提供者：{0}", value);
            }
        }
        #endregion

        public ConnectionDescription()
        {
            InitializeComponent();
        }

        private void ConnectionDescription_Load(object sender, EventArgs e)
        {
            this.BackColor = ColorTranslator.FromHtml("#93CA76");
            this.Dock = DockStyle.Fill;
        }
    }
}
